package me.xuym.md2htm;

import com.cbs.java.component.application.Application;
import com.cbs.java.component.application.BaseArgs;
import me.xuym.md2htm.entity.Args;
import org.fusesource.jansi.Ansi;

public class MyApplication extends Application {
    private Args myArgs = new Args();


    public static void main(String[] args) {
        MyApplication myApplication = new MyApplication(args);
        myApplication.start();
    }

    public MyApplication(String[] args) {
        super(args);
    }

    @Override
    public String applicationName() {
        return "md2htm";
    }

    @Override
    public BaseArgs getArgs() {
        return myArgs;
    }

    @Override
    public void start() {
        super.start();

        System.out.println(Ansi.ansi().fg(Ansi.Color.BLUE).a("Welcome to md2htm"));

        if (myArgs.isHelp()) {
            // display help
            return;
        }

        TranslateAction translator = new TranslateAction(this);
        translator.translate();
    }
}